[uwsgi]
chdir = {{ PROJ_HOME }}/WeCron
# chdir = WeCron
wsgi-file = wecron/wsgi.py
virtualenv = {{ PROJ_VENV }}
# strict = True
# http-socket = 0.0.0.0:9090
socket = /tmp/wecron-uwsgi.sock
chmod-socket = 666
log-format = %(addr) - worker:%(wid) - [%(ltime)] "%(method) %(uri) %(proto)" %(status) %(size) %(msecs)ms "%(referer)" "%(uagent)"

uid = www-data
gid = www-data

env = LC_ALL=en_US.UTF-8
env = PYTHONIOENCODING=utf8

master = True
enable-threads = True
single-interpreter = True
lazy-apps = True  # This is important for apscheduler to work
processes = 2

# static files
route = \.php$ break:403 Forbidden
# route = ^/favicon\.ico$ static:staticfiles/favicon.ico
# route = ^/robots\.txt$ static:staticfiles/robots.txt
static-map = /static=./staticfiles
check-static = ./staticfiles
# cache all static files for a year
route = ^/static/ addheader:Cache-control: max-age=31536000

add-header = uWSGI-Encoding: gzip
http-keepalive = True
http-auto-gzip = True
http-auto-chunked = True
http-auto-chunked = True

pidfile = /tmp/wecron-uwsgi.pid
# daemonize = /var/log/wecron/app.log

# every day at 1:00
unique-cron = 0 1 -1 -1 -1 python ./manage.py update_user || echo 'ERRORRRRRRRRRRRRRRRRRRRRRRRRRRRRR'
cron-harakiri = 3600

# destroy workers blocked for more than 30 seconds
harakiri = 30
max-requests = 1000
vacuum = True
worker-reload-mercy = 5

stats = 127.0.0.1:9191
